To solve the time-consuming and error-prone problem in the diagnosis of fundus images by the ophthalmologists, an unsupervised automatic detection method for hard exudates in fundus images was proposed. Firstly, the blood vessels, dark lesion regions and optic disc were removed by using morphological background estimation in preprocessing phase. Then, with the image luminosity channel taken as the initial image, the low rank matrix and sparse matrix were obtained by combining local entropy and Robust Principal Components Analysis (RPCA) based on the locality and sparsity of hard exudates in fundus images. Finally, the hard exudates regions were obtained by the normalized sparse matrix. The performance of the proposed method was tested on the fundus images databases e-ophtha EX and DIARETDB1. The experimental results show that the proposed method can achieve 91.13% of sensitivity and 90% of specificity in the lesional level and 99.03% of accuracy in the image level and 0.5 s of average running time. It can be seen that the proposed method has higher sensitivity and shorter running time compared with Support Vector Machine (SVM) method and K-means method.